const { Main, Http, Events, Server, Location, Upstream } = require("./model");

const config = new Main({
    user: "www www",
    worker_processes: "auto",
    worker_rlimit_nofile: 65535,
    pid: "nginx.pid",
    error_log: "logs/error.log",
    children: [
        {
            type: "http",
            root: "html",
            children: [
                {
                    type: "server",
                    listen: 80
                }
            ]
        },
        {
            type: "events",
            use: "epoll"
        }
    ]
});
// config.daemon = true;
// config.user = "www www";
// config.errorLog = "logs/error.log fatal";
// const events = new Events();
// events.use = "epoll";
// config.append(events);
// const http = new Http();
// http.root = "html";
// http.authBasic = false;
// config.append(http);
// const server = new Server();
// server.listen = "80";
// server.serverName = "localhost";
// http.append(server);
// const upstream = new Upstream("new");
// upstream.server = "127.0.0.1";
// http.append(upstream);
// server.append(new Location("/"));
// server.append(new Location("= /50x.html"));
console.log(config.build());